package api

import (
	"2302a/audio_podcast/api/handler"
	"2302a/audio_podcast/consts"
	"2302a/audio_podcast/pkg"
	"github.com/gin-gonic/gin"
)

func LoadRouter(r *gin.Engine) {

	api := r.Group("api")
	{
		user := api.Group("user")
		{
			user.POST("/login", handler.Login)
			user.POST("/file", handler.UploadFile)
		}
		audio := api.Group("audio")
		{
			audio.Use(pkg.AuthJwt(consts.JWT_KEY))
			audio.POST("/add", handler.AddAudio)       //音频发布
			audio.POST("/episode", handler.AddEpisode) //音频剧集
			audio.POST("/list", handler.ListAudio)     //列表
		}

	}

}
